\(\int \frac {(c+d x^2)^2}{x (a+b x^2)^2} \, dx\) [276]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 22, antiderivative size = 67 \[ \int \frac {\left (c+d x^2\right )^2}{x \left (a+b x^2\right )^2} \, dx=\frac {(b c-a d)^2}{2 a b^2 \left (a+b x^2\right )}+\frac {c^2 \log (x)}{a^2}-\frac {1}{2} \left (\frac {c^2}{a^2}-\frac {d^2}{b^2}\right ) \log \left (a+b x^2\right ) \]

[Out]

1/2*(-a*d+b*c)^2/a/b^2/(b*x^2+a)+c^2*ln(x)/a^2-1/2*(c^2/a^2-d^2/b^2)*ln(b*x^2+a)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {457, 90} \[ \int \frac {\left (c+d x^2\right )^2}{x \left (a+b x^2\right )^2} \, dx=-\frac {1}{2} \left (\frac {c^2}{a^2}-\frac {d^2}{b^2}\right ) \log \left (a+b x^2\right )+\frac {c^2 \log (x)}{a^2}+\frac {(b c-a d)^2}{2 a b^2 \left (a+b x^2\right )} \]

[In]

Int[(c + d*x^2)^2/(x*(a + b*x^2)^2),x]

[Out]

(b*c - a*d)^2/(2*a*b^2*(a + b*x^2)) + (c^2*Log[x])/a^2 - ((c^2/a^2 - d^2/b^2)*Log[a + b*x^2])/2

Rule 90

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 457

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \text {Subst}\left (\int \frac {(c+d x)^2}{x (a+b x)^2} \, dx,x,x^2\right ) \\ & = \frac {1}{2} \text {Subst}\left (\int \left (\frac {c^2}{a^2 x}-\frac {(-b c+a d)^2}{a b (a+b x)^2}+\frac {-b^2 c^2+a^2 d^2}{a^2 b (a+b x)}\right ) \, dx,x,x^2\right ) \\ & = \frac {(b c-a d)^2}{2 a b^2 \left (a+b x^2\right )}+\frac {c^2 \log (x)}{a^2}-\frac {1}{2} \left (\frac {c^2}{a^2}-\frac {d^2}{b^2}\right ) \log \left (a+b x^2\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.04 \[ \int \frac {\left (c+d x^2\right )^2}{x \left (a+b x^2\right )^2} \, dx=\frac {2 c^2 \log (x)+\frac {(-b c+a d) \left (a (-b c+a d)+(b c+a d) \left (a+b x^2\right ) \log \left (a+b x^2\right )\right )}{b^2 \left (a+b x^2\right )}}{2 a^2} \]

[In]

Integrate[(c + d*x^2)^2/(x*(a + b*x^2)^2),x]

[Out]

(2*c^2*Log[x] + ((-(b*c) + a*d)*(a*(-(b*c) + a*d) + (b*c + a*d)*(a + b*x^2)*Log[a + b*x^2]))/(b^2*(a + b*x^2))
)/(2*a^2)

Maple [A] (verified)

Time = 2.64 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.99

method result size
default \(\frac {c^{2} \ln \left (x \right )}{a^{2}}+\frac {\left (a d -b c \right ) \left (\frac {\left (a d +b c \right ) \ln \left (b \,x^{2}+a \right )}{b^{2}}+\frac {\left (a d -b c \right ) a}{b^{2} \left (b \,x^{2}+a \right )}\right )}{2 a^{2}}\) \(66\)
norman \(\frac {a^{2} d^{2}-2 a b c d +b^{2} c^{2}}{2 a \,b^{2} \left (b \,x^{2}+a \right )}+\frac {c^{2} \ln \left (x \right )}{a^{2}}+\frac {\left (a^{2} d^{2}-b^{2} c^{2}\right ) \ln \left (b \,x^{2}+a \right )}{2 a^{2} b^{2}}\) \(81\)
risch \(\frac {a \,d^{2}}{2 b^{2} \left (b \,x^{2}+a \right )}-\frac {c d}{b \left (b \,x^{2}+a \right )}+\frac {c^{2}}{2 a \left (b \,x^{2}+a \right )}+\frac {c^{2} \ln \left (x \right )}{a^{2}}+\frac {\ln \left (-b \,x^{2}-a \right ) d^{2}}{2 b^{2}}-\frac {\ln \left (-b \,x^{2}-a \right ) c^{2}}{2 a^{2}}\) \(100\)
parallelrisch \(\frac {2 \ln \left (x \right ) x^{2} b^{3} c^{2}+\ln \left (b \,x^{2}+a \right ) x^{2} a^{2} b \,d^{2}-\ln \left (b \,x^{2}+a \right ) x^{2} b^{3} c^{2}+2 \ln \left (x \right ) a \,b^{2} c^{2}+\ln \left (b \,x^{2}+a \right ) a^{3} d^{2}-\ln \left (b \,x^{2}+a \right ) a \,b^{2} c^{2}+a^{3} d^{2}-2 a^{2} b c d +b^{2} c^{2} a}{2 a^{2} b^{2} \left (b \,x^{2}+a \right )}\) \(136\)

[In]

int((d*x^2+c)^2/x/(b*x^2+a)^2,x,method=_RETURNVERBOSE)

[Out]

c^2*ln(x)/a^2+1/2/a^2*(a*d-b*c)*((a*d+b*c)/b^2*ln(b*x^2+a)+(a*d-b*c)*a/b^2/(b*x^2+a))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.75 \[ \int \frac {\left (c+d x^2\right )^2}{x \left (a+b x^2\right )^2} \, dx=\frac {a b^{2} c^{2} - 2 \, a^{2} b c d + a^{3} d^{2} - {\left (a b^{2} c^{2} - a^{3} d^{2} + {\left (b^{3} c^{2} - a^{2} b d^{2}\right )} x^{2}\right )} \log \left (b x^{2} + a\right ) + 2 \, {\left (b^{3} c^{2} x^{2} + a b^{2} c^{2}\right )} \log \left (x\right )}{2 \, {\left (a^{2} b^{3} x^{2} + a^{3} b^{2}\right )}} \]

[In]

integrate((d*x^2+c)^2/x/(b*x^2+a)^2,x, algorithm="fricas")

[Out]

1/2*(a*b^2*c^2 - 2*a^2*b*c*d + a^3*d^2 - (a*b^2*c^2 - a^3*d^2 + (b^3*c^2 - a^2*b*d^2)*x^2)*log(b*x^2 + a) + 2*
(b^3*c^2*x^2 + a*b^2*c^2)*log(x))/(a^2*b^3*x^2 + a^3*b^2)

Sympy [A] (verification not implemented)

Time = 0.71 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.19 \[ \int \frac {\left (c+d x^2\right )^2}{x \left (a+b x^2\right )^2} \, dx=\frac {a^{2} d^{2} - 2 a b c d + b^{2} c^{2}}{2 a^{2} b^{2} + 2 a b^{3} x^{2}} + \frac {c^{2} \log {\left (x \right )}}{a^{2}} + \frac {\left (a d - b c\right ) \left (a d + b c\right ) \log {\left (\frac {a}{b} + x^{2} \right )}}{2 a^{2} b^{2}} \]

[In]

integrate((d*x**2+c)**2/x/(b*x**2+a)**2,x)

[Out]

(a**2*d**2 - 2*a*b*c*d + b**2*c**2)/(2*a**2*b**2 + 2*a*b**3*x**2) + c**2*log(x)/a**2 + (a*d - b*c)*(a*d + b*c)
*log(a/b + x**2)/(2*a**2*b**2)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.28 \[ \int \frac {\left (c+d x^2\right )^2}{x \left (a+b x^2\right )^2} \, dx=\frac {c^{2} \log \left (x^{2}\right )}{2 \, a^{2}} + \frac {b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}}{2 \, {\left (a b^{3} x^{2} + a^{2} b^{2}\right )}} - \frac {{\left (b^{2} c^{2} - a^{2} d^{2}\right )} \log \left (b x^{2} + a\right )}{2 \, a^{2} b^{2}} \]

[In]

integrate((d*x^2+c)^2/x/(b*x^2+a)^2,x, algorithm="maxima")

[Out]

1/2*c^2*log(x^2)/a^2 + 1/2*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)/(a*b^3*x^2 + a^2*b^2) - 1/2*(b^2*c^2 - a^2*d^2)*log
(b*x^2 + a)/(a^2*b^2)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.48 \[ \int \frac {\left (c+d x^2\right )^2}{x \left (a+b x^2\right )^2} \, dx=\frac {c^{2} \log \left (x^{2}\right )}{2 \, a^{2}} - \frac {{\left (b^{2} c^{2} - a^{2} d^{2}\right )} \log \left ({\left | b x^{2} + a \right |}\right )}{2 \, a^{2} b^{2}} + \frac {b^{2} c^{2} x^{2} - a^{2} d^{2} x^{2} + 2 \, a b c^{2} - 2 \, a^{2} c d}{2 \, {\left (b x^{2} + a\right )} a^{2} b} \]

[In]

integrate((d*x^2+c)^2/x/(b*x^2+a)^2,x, algorithm="giac")

[Out]

1/2*c^2*log(x^2)/a^2 - 1/2*(b^2*c^2 - a^2*d^2)*log(abs(b*x^2 + a))/(a^2*b^2) + 1/2*(b^2*c^2*x^2 - a^2*d^2*x^2
+ 2*a*b*c^2 - 2*a^2*c*d)/((b*x^2 + a)*a^2*b)

Mupad [B] (verification not implemented)

Time = 4.80 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.19 \[ \int \frac {\left (c+d x^2\right )^2}{x \left (a+b x^2\right )^2} \, dx=\frac {c^2\,\ln \left (x\right )}{a^2}+\frac {a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2}{2\,a\,b^2\,\left (b\,x^2+a\right )}+\frac {\ln \left (b\,x^2+a\right )\,\left (a^2\,d^2-b^2\,c^2\right )}{2\,a^2\,b^2} \]

[In]

int((c + d*x^2)^2/(x*(a + b*x^2)^2),x)

[Out]

(c^2*log(x))/a^2 + (a^2*d^2 + b^2*c^2 - 2*a*b*c*d)/(2*a*b^2*(a + b*x^2)) + (log(a + b*x^2)*(a^2*d^2 - b^2*c^2)
)/(2*a^2*b^2)